package test.iceiceice.com.apptest.core;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by Administrator on 2017/9/21.
 */

public class DataBindUtils {// 这段代码你可以写在任意文件中

    @BindingAdapter("android:src")
    public static void setImageUrl(ImageView view, String url) {
        Glide.with(view.getContext()).load(url).dontAnimate().centerCrop().into(view);
    }

    @BindingAdapter("url")
    public static void setImageUrl2(ImageView view, String url) {
        Glide.with(view.getContext()).load(url).dontAnimate().centerCrop().into(view);
    }
}
